// pages/nearby/nearby.js
const app = getApp()
import {
    getParkBillListApi,
  } from "../../api/index.js";
Page({

  /**
   * 页面的初始数据
   */
  data: {
    statusBarHeight: app.globalData.statusBarHeight,
    pageHeight: app.globalData.pageHeight - 500,
    token: wx.getStorageSync('token'),
    billInfo:{},
    parkValue:'',
    settledStatus:''
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    console.log('参数:', options)
    if (wx.getUserProfile) {
      this.setData({ canIUseGetUserProfile: true })
    }
    if(options.parkId) {
        this.setData({
            settledStatus:options.settledStatus,
            parkValue:options.parkValue
        })
        this.getParkBillList(options.parkId)
    }
    // 获取屏幕高度
    this.setData({
      screenHeight: wx.getSystemInfoSync().screenHeight,
      token: wx.getStorageSync('token'),
    })
  },
    //获取账单信息

    async getParkBillList(parkId) {
        try {
          const { data: res } = await getParkBillListApi({parkId});
          console.log(res);
          this.setData({
            billInfo: res.data[0],
          });
        } catch (error) {}
      },



})
